package model.handlers;

import database.Database;
import java.sql.SQLException;
import model.Telephone;

/**
 * 
 * @author Sonny Sandberg
 */
public abstract class TelephoneHandler 
{
    public static int doesPhoneExist(Telephone phone) throws SQLException, ClassNotFoundException
    {
        Database db = new Database();
        
        String[][] results = db.getFromDB("bs_customer_telephone", "WHERE number = '"+phone.getNumber()+"'", "", "", "number");
        db.closeDB();
        
        return results.length;
    }
}